home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 263_02 / message.c < prev    next >
Text File  |  1990-02-13  |  839b  |  36 lines

  1. #include <stdio.h>
  2. #include <c_wndw.h>
  3. int test_value (int);
  4. /*
  5. *    Copyright 1989, Marietta Systems, Inc.
  6. *    All rights reserved
  7. */
  8.  
  9. /*
  10. *    function to test range of value, returns positive if OK, or negative
  11. */
  12. int test_value (int i)
  13. {
  14.      if (i > 23 || i < 1)
  15.           return err_wndw (" Number out of range ", 0, -2);
  16.      else return err_wndw (" Number is OK ", 0, 9);
  17. }
  18.  
  19. /*
  20. *    Program to show the use of message and query windows
  21. */
  22. void main ()
  23. {
  24.      int i = 10, x = 1, ret;
  25.      clr_scrn ("Message windows");
  26.      do
  27.      {
  28.           display ("Enter value: ", x++, 1, high);
  29.           ret = acptint (&i, decimal, alt_high, 2);
  30.           if (ret == QUIT) break; /* trap F10 key */
  31.           test_value (i);
  32.      } while ( qry_wndw (" Continue with entry of numbers? ") );
  33. /* end the program */
  34.      goodbye (0);
  35. }
  36.